﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using XNAGameEngine;
using XNAGameEngine.GameState;
using XNAGameEngine.GUI;
using XNAGameEngine.Input;
using XNAGameEngine.GameObject;
using XNAGameEngine.Audio;

namespace XNAGame 
{
    class WorldMapState : GameState
    {
        Texture2D Worldbg;

        public WorldMapState(string stringReference, IManagerGameState stateManager)
            : base(stringReference, stateManager)
        { }

        public override void Initialize()
        {
            base.Initialize();
            GameEngine.GetService<IManagerGUI>().LoadGUILayout("WorldMapGUI");
            GameEngine.GetService<IManagerAudio2D>().NextSong();
            Worldbg = GameEngine.GameContent.Load<Texture2D>("Content\\Textures\\WorldmapBG");

        }

        public override void Cleanup()
        {
            GameEngine.GetService<IManagerGUI>().UnloadGUILayout();
            base.Cleanup();
        }

        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);

            Game.GraphicsDevice.Clear(Color.Green);

            GameEngine.SpriteBatch.Begin();

            GameEngine.SpriteBatch.Draw(
                Worldbg,
                new Rectangle(0, 0, Worldbg.Width,
                Worldbg.Height), null,
                Color.White, 0, Vector2.Zero,
                SpriteEffects.None, 0);

            GameEngine.SpriteBatch.End();
            base.Draw(gameTime);
        }
    }
}
